home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing;
-
- import com.sun.java.swing.border.Border;
- import com.sun.java.swing.plaf.UIResource;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Font;
-
- public abstract class LookAndFeel {
- public UIDefaults getDefaults() {
- return null;
- }
-
- public abstract String getDescription();
-
- public abstract String getID();
-
- public abstract String getName();
-
- public void initialize() {
- }
-
- public static void installBorder(JComponent c, String defaultBorderName) {
- Border b = c.getBorder();
- if (b == null || b instanceof UIResource) {
- c.setBorder(UIManager.getBorder(defaultBorderName));
- }
-
- }
-
- public static void installColors(JComponent c, String defaultBgName, String defaultFgName) {
- Color bg = ((Component)c).getBackground();
- if (bg == null || bg instanceof UIResource) {
- ((Component)c).setBackground(UIManager.getColor(defaultBgName));
- }
-
- Color fg = ((Component)c).getForeground();
- if (fg == null || fg instanceof UIResource) {
- ((Component)c).setForeground(UIManager.getColor(defaultFgName));
- }
-
- }
-
- public static void installColorsAndFont(JComponent c, String defaultBgName, String defaultFgName, String defaultFontName) {
- Font f = ((Component)c).getFont();
- if (f == null || f instanceof UIResource) {
- ((Component)c).setFont(UIManager.getFont(defaultFontName));
- }
-
- installColors(c, defaultBgName, defaultFgName);
- }
-
- public abstract boolean isNativeLookAndFeel();
-
- public abstract boolean isSupportedLookAndFeel();
-
- public static Object makeIcon(Class baseClass, String gifFile) {
- return new 1(baseClass, gifFile);
- }
-
- public String toString() {
- return "[" + this.getDescription() + " - " + this.getClass().getName() + "]";
- }
-
- public void uninitialize() {
- }
-
- public static void uninstallBorder(JComponent c) {
- if (c.getBorder() instanceof UIResource) {
- c.setBorder((Border)null);
- }
-
- }
- }
-